<extend name="Base/commoncenter"/>

<block name="body">
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">收货地址</div>
        <div class="panel-body">
            <p>新增加收货地址</p>
            <form class="form-horizontal" id="addressform" role="form"  action="{:U('myaddressadd')}" method="POST">
                <div class="form-group">
                    <label class="col-sm-2 control-label">国家选择</label>
                    <div class="col-sm-10">
                        <select name="countryid" class="form-control" >
                            <foreach name="countrylist" item="vo" >
                                <option value="{$vo.country_id}">[{$vo.code}] {$vo.name_chinese}</option>
                            </foreach>     

                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">国家</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="country" placeholder="国家名称" datatype="*" nullmsg="请填写国家名称！">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">省/州</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="province" placeholder="省/州名称" datatype="*" nullmsg="请填写省/州名称！">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">城市</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="city" placeholder="城市名称" datatype="*" nullmsg="请填写城市名称！">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">详细的地址</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="location" placeholder="详细的街道地址" datatype="*" nullmsg="请填写详细的地址！">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">邮政编码</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="zipcode" placeholder="邮政编码" datatype="*" nullmsg="请填写邮政编码！">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">收货人姓名</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="name" placeholder="收货人姓名" datatype="*" nullmsg="请填收货人姓名！">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">收货人电话</label>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" name="phone" placeholder="收货人电话" datatype="*" nullmsg="请填收货人电话！">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-success"> <span class="glyphicon glyphicon-book"></span> 添加收货地址  </button>
                    </div>
                </div>
            </form>
            <!------------------->
        </div>
        <script>
            $("#addressform").Validform();
        </script>
        <!-- Table -->
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>收货人</th>
                    <th>国家</th>
                    <th>所在地区</th>
                    <th>街道地址</th>
                    <th>邮编</th>
                    <th>联系电话</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="addresslist" id="vo">
                <tr>
                    <td>{$vo.name}</td>
                    <td>{$vo.country}</td>
                    <td>{$vo.province}{$vo.city}</td>
                    <td>{$vo.location}</td>
                    <td>{$vo.zipcode}</td>
                    <td>{$vo.phone}</td>
                    <td><a href="{:U('myaddressedit?id='.$vo['id'].'')}">编辑</a>   <a href="{:U('myaddressdel?id='.$vo['id'].'')}" onclick="javascript:return de_confirm();">删除</a></td>
                </tr> 
                </volist>
            </tbody>
        </table>
    </div>
</block>